package com.edu.study.base.rest;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.edu.study.base.wordLearn.service.IEduWordLearnService;
import com.ruoyi.common.core.domain.AjaxResult;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 *    我的学习档案
     * @ClassName: AppLearnPortfolioController
     * @Description: TODO(这里用一句话描述这个类的作用)
     * @author lzs
     * @date 2021年8月3日
     *
 */

@Api(tags = "我的学习档案")
@RestController
@RequestMapping("/api/learnPortfolio")
public class AppLearnPortfolioController {

	@Autowired
	private IEduWordLearnService eduWordLearnService;
	
    /**
     * 获取学习档案中我的目标生词数量和等级生词数量
     */ 
    @GetMapping("/getEduWordLearnNum")
    @ApiOperation("获取学习档案中我的目标生词数量和等级生词数量")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "memberId", value = "会员ID",required = true), 
       })
    public AjaxResult getWordNum(String memberId)
    {
    	AjaxResult data = AjaxResult.success();
    	// TODO 目标生词数量
    	data.put("targerNewWordNum", 343);
    	
    	// TODO  等级生词数量
    	data.put("levelNewWordNum", 435);
    	
    	return data;
    }
    
    /**
     * 获取近7天或近7天和一个月我的生词量
     */ 
    @GetMapping("/getDayNum")
    @ApiOperation("获取近7天或近7天和一个月我的生词量")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "memberId", value = "会员ID",required = true), 
            @ApiImplicitParam(name = "day", value = "天数",required = true), 
       })
    public AjaxResult getWordNum(String memberId,String day)
    {
    	AjaxResult data = AjaxResult.success();
    	Map<String, Object> map= eduWordLearnService.getDayNum(memberId,day);
    	data.putAll(map);
     	return data;
    }
}
